#ifndef _IM_SERVER_FILE_RELOAD_TIMER_
#define _IM_SERVER_FILE_RELOAD_TIMER_

#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/enable_shared_from_this.hpp>

class FileReloadTimer : public boost::enable_shared_from_this<FileReloadTimer> {
public:
  FileReloadTimer(boost::asio::io_service& io_service, int interval) :
    io_service_(io_service),
    timer_(io_service),
    interval_(interval) {
  }

  void Start();

private:
  void Handle(const boost::system::error_code& error);

private:
  boost::asio::io_service& io_service_;
  boost::asio::deadline_timer timer_;
  int interval_; // 间隔时长，单位为秒
};

#endif // _IM_SERVER_FILE_RELOAD_TIMER_
